package com.dkh.recommend.controller;

import com.dkh.recommend.dto.Result;
import com.dkh.recommend.service.ITbFollowService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Slf4j
@RestController
@Api(value = "收藏夹", tags = "收藏夹-相关", description="收藏夹-相关")
@RequestMapping("follow")
public class FollowController {

    @Resource
    private ITbFollowService followService;

//    查看我的关注列表
        @GetMapping("/myfollowlist")
       public Result MyFollowList(){
            return followService.MyFollowList();
        }
//    关注、取消关注
      @PutMapping("/{id}/{isFollow}")
    public Result Follow(@PathVariable("id") Long followUserId,@PathVariable("isFollow") Boolean isFollow){
            return followService.Follow(followUserId,isFollow);
      }
//todo  关注
//    是否关注该用户了
    @GetMapping("/or/not/{id}")
    public Result IsFollow(@PathVariable("id") Long followUserId){
            return followService.IsFollow(followUserId);
    }

//    共同关注
    @GetMapping("/common/{id}")
    public Result FollowCommons(@PathVariable("id")Long id){
            return followService.FollowCommons(id);
    }

}
